<?php

namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Http\Request;

class UserRepositoriesController extends Controller
{
    /**
     * Handle the incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function __invoke(User $user)
    {
        $repositories = $user->repositories()->indexQuery()->paginate();

        return view('resources.user.repositories')->with('user', $user)->with('repositories', $repositories);
    }
}
